//
//  I_Account.h
//  YunDongAdmin
//
//  Created by lqq on 2018/9/4.
//  Copyright © 2018年 cloudfighting.com. All rights reserved.
//

#import "I_Base.h"
#import "M_Account.h"
@interface I_Account : I_Base

/**
 手机号加验证码登录
 */
+ (NetworkTask *)smsLoginWithMobile:(NSString *)mobile
                               code:(NSString *)code
                            success:(void(^)(M_Account *account))successBlock
                            failure:(ErrorBlock)failureBlock;

/**
 账号登录
 */
+ (NetworkTask *)loginWithAccount:(NSString *)account
                              PWD:(NSString *)PWD
                          success:(void(^)(M_Account *account))successBlock
                          failure:(ErrorBlock)failureBlock;


/**
 修改密码
 */
+ (NetworkTask *)modifyPWDWithOldPWD:(NSString *)oldPwd
                              newPwd:(NSString *)newPwd
                             success:(void(^)(void))successBlock
                             failure:(ErrorBlock)failureBlock;

/**
 微信登录
 
 @param accessToken 微信accessToken
 @param openId 微信openID
 @param unionid 微信unionId
 @param successBlock 成功回调
 @param failureBlock 失败回调
 
 */
+ (NetworkTask *)loginByWeixinWithAccessToken:(NSString *)accessToken
                                    andOpenId:(NSString *)openId
                                   andUnionid:(NSString *)unionid
                                      success:(void(^)(M_Account *account))successBlock
                                      failure:(ErrorBlock)failureBlock;


/**
 获取账户过期时间
 */
+ (NetworkTask *)requestAccountEndDateOnSuccess:(void(^)(long long endDate))successBlock
                                      failure:(ErrorBlock)failureBlock;


@end
